<?php
/*
  Template Name: HomePage
 */
?>
<?php get_header() ?>
<div id="main" class="row">
    <div class="small-8 large-8 column">
        <div class="slide-bar">

        </div>
        <div class="content">
            <div class="home-top">
                <?php
                $args = array('category_name' => 'main-top','order' => 'ASC',);

                $myposts = get_posts($args);
                foreach ($myposts as $post) : setup_postdata($post);
                    ?>
                <div class="home-post">
                    <div class="home-title">
                        <a href="<?php the_permalink(); ?>"><?php echo get_post_meta(get_the_ID(), 'tagline', true); ?></a>
                        <p><?php echo get_post_meta(get_the_ID(), 'description', true); ?></p>
                    </div>
                    <a href="<?php the_permalink(); ?>"><img src="<?php echo get_post_meta(get_the_ID(), 'thumbnail', true); ?>"/></a>
                    </div>
                <?php
                endforeach;
                wp_reset_postdata();
                ?>
            </div>
            <?php
            if (have_posts()): while (have_posts()): the_post();
                    the_content('');
                endwhile;
            else:
                ?>
            <p>Sorry, there are nothing to show</p>
            <?php endif; ?>
        </div>
    </div>
    <!--end .main-content-->
    <div class="sidebar small-4 large-4 column">
<?php get_sidebar() ?>
    </div>
    <!--end .sidebar-->
</div>
<!--end #main-->
<?php get_footer(); ?>